package com.dinzeer.sjapadder.sa;

import com.dinzeer.legendreliclib.lib.compat.slashblade.Drives;
import com.dinzeer.legendreliclib.lib.util.WaitingTick;
import com.dinzeer.sjapadder.register.SjaStacksReg;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;

import static com.dinzeer.sjapadder.Config.*;

public class WaveEdgeSuper {


    public static void doslash(LivingEntity entity){
        int count = countWaveEdgeSuperBase;
        if (entity instanceof Player player){
            if (costWaveEdgeSuperBoost > 0 && SjaStacksReg.BoostTrigger.getCurrentStacks(player) >= costWaveEdgeSuperBoost){
                count += costWaveEdgeSuperBoost;
                SjaStacksReg.BoostTrigger.addStacks(player, -costWaveEdgeSuperBoost);
            }
        }
        for (int i = 1; i < count; i++){
            WaitingTick.schedule(i*2, () -> {
                Drives.spawnCircularDrives(entity, 10, waveEdgeSuperDriveDamage, 90, 20);
            });

        }
    }
}
